<?php
include($_SERVER["DOCUMENT_ROOT"]."/db.inc.php");

function Big5ToGB($strTable, $strBig5F, $strGBF){
	global $_Conn;

	$strSQL = "select ID, ".$strBig5F." as Big5F from `".$strTable."`";
	if(!$RS = PMA_mysql_query($strSQL))exit(PMA_mysql_error($_Conn));

	while($Rows = PMA_mysql_fetch_object($RS)){
		$strSQL = "update `".$strTable."` set ".$strGBF." = '".iconv("BIG5", "GB2312", $Rows -> Big5F)."' where ID = ".$Rows -> ID;
		if(!PMA_mysql_query($strSQL))exit(PMA_mysql_error($_Conn));
	}

	print $strTable." OK!!<br>\n";
}

Big5ToGB("bet_BetType", "Type_Value_1", "Type_Value_3");
Big5ToGB("bet_MarqueeSite", "Sites_1", "Sites_3");
Big5ToGB("bet_MemberGroup", "GroupName_1", "GroupName_3");
?>